/**
 * Created by jiachenpan on 16/11/18.
 */

export function isvalidUsername(str) {
  const valid_map = ['admin', 'editor']
  return valid_map.indexOf(str.trim()) >= 0
}

export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}


/* 手机号码*/
export function validatePhone(number) {
  const re = /^[1][3,4,5,7,8][0-9]{9}$/
  return re.test(number)
}
